package cn.beyond.vehicleManagement.dao;

import cn.beyond.vehicleManagement.pojo.SysRole;
import cn.beyond.vehicleManagement.pojo.VehicleRepair;
import cn.beyond.vehicleManagement.util.DataBaseUtil;

import java.util.List;
import java.util.Map;

public class VehicleRepairDao {
    DataBaseUtil<VehicleRepair> userDao=new DataBaseUtil<>();

    /**
     * 添加车辆维修记录
     * @return
     */
    public int addVehicleRepair(VehicleRepair vehicleRepair){
        return    userDao.addUtil(vehicleRepair,"vehicle_repair");
    }

    /**
     * 删除车辆维修记录
     * @param obj
     * @param column
     * @return
     */
    public int deleteVehicleRepair(Object obj,String column){
        return userDao.delByIdUtil(obj,"vehicle_repair",column);

    }

    /**
     * 修改车辆维修记录
     * @return
     */
    public int update(VehicleRepair vehicleRepair){
        return  userDao.updateByidUtil(vehicleRepair,"vehicle_repair");
    }

    /**
     * 查询结果返回单条记录
     * @param selectmap
     * @return
     */
    public VehicleRepair selectVehicleRepairByOne(VehicleRepair vehicleRepair, Map<String, Object> selectmap){
        return userDao.selectONE(vehicleRepair,"vehicle_repair",selectmap);
    }

    /**
     * 查询结果返回多条记录
     * @param selectmap
     * @return
     */
    public List<VehicleRepair> selectUserByCondition(VehicleRepair vehicleRepair,
                                                     Map<String, Object> selectmap){
        return  userDao.selectAll(vehicleRepair,"vehicle_repair",selectmap);
    }
}
